/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package bs.facturacion.vista;

import bs.entidad.modelo.EntidadComercial;
import bs.global.modelo.CodigoPostal;
import bs.global.modelo.Transporte;
import bs.stock.modelo.Deposito;
import bs.ventas.modelo.CondicionDePagoVenta;
import bs.ventas.modelo.ListaDePrecio;
import bs.ventas.modelo.Vendedor;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 *
 * @author Claudio
 */
@Entity
@Table(name = "fc_pendiente_grupo")
@IdClass(PendienteFacturacionGrupoPK.class)
public class PendienteFacturacionGrupo implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Column(name = "CIRCOM", length = 2)
    private String circom;
    
    @Id
    @Column(name = "NROCTA")
    private String nrocta;
    
    @Id
    @Column(name = "CNDPAG", length = 6)
    private String cndpag;
        
    @Id
    @Column(name = "VNDDOR", length = 6)
    private String vnddor;
        
    @Id
    @Column(name = "DEPING", length = 6)
    private String deping;
        
    @Id
    @Column(name = "DEPEGR", length = 6)
    private String depegr;
        
    @Id
    @Column(name = "CODLIS", length = 6)
    private String codlis;
        
    @Id
    @Column(name = "CODPOS", length = 6)
    private String codpos;
        
    @Id
    @Column(name = "CODTRA", length = 6)
    private String codtra;

    
    @Column(name = "PENDIENTE", nullable = false)
    private long pendiente;
    
    
    @JoinColumn(name = "NROCTA", referencedColumnName = "NROCTA", nullable = false, insertable = false, updatable = false)
    @ManyToOne(fetch = FetchType.EAGER)
    private EntidadComercial cliente;
    
    @JoinColumn(name = "CNDPAG", referencedColumnName = "CODIGO", nullable = false, insertable = false, updatable = false)
    @ManyToOne(fetch = FetchType.LAZY)
    private CondicionDePagoVenta condicionDePago;
    
    //VT_Vendedor
    @JoinColumn(name = "VNDDOR", referencedColumnName = "CODIGO", nullable = false,insertable = false, updatable = false)
    @ManyToOne(fetch = FetchType.LAZY)
    private Vendedor vendedor;
    
    @JoinColumn(name = "DEPING", referencedColumnName = "CODIGO", nullable = true,insertable = false, updatable = false)
    @ManyToOne(fetch = FetchType.LAZY)
    private Deposito depositoIngreso;
    
    
    @JoinColumn(name = "DEPEGR", referencedColumnName = "CODIGO", nullable = true,insertable = false, updatable = false)
    @ManyToOne(fetch = FetchType.LAZY)
    private Deposito depositoEgreso;

    //Lista de precio
    @JoinColumn(name = "CODLIS", referencedColumnName = "CODIGO", nullable = false,insertable = false, updatable = false)
    @ManyToOne(fetch = FetchType.LAZY)
    private ListaDePrecio listaDePrecio;
    
        //Codigo postal entrega    
    @JoinColumn(name = "CODPOS", referencedColumnName = "ID", nullable = false,insertable = false, updatable = false)
    @ManyToOne(fetch = FetchType.LAZY)
    private CodigoPostal codigoPostal;

    //Transportista
    @JoinColumn(name = "CODTRA", referencedColumnName = "CODIGO", nullable = false,insertable = false, updatable = false)
    @ManyToOne(fetch = FetchType.LAZY)
    private Transporte transporte;
        
    public PendienteFacturacionGrupo() {

    }

    public String getCircom() {
        return circom;
    }

    public void setCircom(String circom) {
        this.circom = circom;
    }

    public String getNrocta() {
        return nrocta;
    }

    public void setNrocta(String nrocta) {
        this.nrocta = nrocta;
    }

    public String getCndpag() {
        return cndpag;
    }

    public void setCndpag(String cndpag) {
        this.cndpag = cndpag;
    }

    public EntidadComercial getCliente() {
        return cliente;
    }

    public void setCliente(EntidadComercial cliente) {
        this.cliente = cliente;
    }

    public CondicionDePagoVenta getCondicionDePago() {
        return condicionDePago;
    }

    public void setCondicionDePago(CondicionDePagoVenta condicionDePago) {
        this.condicionDePago = condicionDePago;
    }

    public long getPendiente() {
        return pendiente;
    }

    public void setPendiente(long pendiente) {
        this.pendiente = pendiente;
    }

    public Vendedor getVendedor() {
        return vendedor;
    }

    public void setVendedor(Vendedor vendedor) {
        this.vendedor = vendedor;
    }

    public Deposito getDepositoIngreso() {
        return depositoIngreso;
    }

    public void setDepositoIngreso(Deposito depositoIngreso) {
        this.depositoIngreso = depositoIngreso;
    }

    public Deposito getDepositoEgreso() {
        return depositoEgreso;
    }

    public void setDepositoEgreso(Deposito depositoEgreso) {
        this.depositoEgreso = depositoEgreso;
    }

    public ListaDePrecio getListaDePrecio() {
        return listaDePrecio;
    }

    public void setListaDePrecio(ListaDePrecio listaDePrecio) {
        this.listaDePrecio = listaDePrecio;
    }

    public CodigoPostal getCodigoPostal() {
        return codigoPostal;
    }

    public void setCodigoPostal(CodigoPostal codigoPostal) {
        this.codigoPostal = codigoPostal;
    }

    public Transporte getTransporte() {
        return transporte;
    }

    public void setTransporte(Transporte transporte) {
        this.transporte = transporte;
    }

    public String getVnddor() {
        return vnddor;
    }

    public void setVnddor(String vnddor) {
        this.vnddor = vnddor;
    }

    public String getDeping() {
        return deping;
    }

    public void setDeping(String deping) {
        this.deping = deping;
    }

    public String getDepegr() {
        return depegr;
    }

    public void setDepegr(String depegr) {
        this.depegr = depegr;
    }

    public String getCodlis() {
        return codlis;
    }

    public void setCodlis(String codlis) {
        this.codlis = codlis;
    }

    public String getCodpos() {
        return codpos;
    }

    public void setCodpos(String codpos) {
        this.codpos = codpos;
    }

    public String getCodtra() {
        return codtra;
    }

    public void setCodtra(String codtra) {
        this.codtra = codtra;
    }
    
    @Override
    public int hashCode() {
        int hash = 7;
        hash = 59 * hash + (this.circom != null ? this.circom.hashCode() : 0);
        hash = 59 * hash + (this.nrocta != null ? this.nrocta.hashCode() : 0);
        hash = 59 * hash + (this.cndpag != null ? this.cndpag.hashCode() : 0);
        hash = 59 * hash + (this.vnddor != null ? this.vnddor.hashCode() : 0);
        hash = 59 * hash + (this.deping != null ? this.deping.hashCode() : 0);
        hash = 59 * hash + (this.depegr != null ? this.depegr.hashCode() : 0);
        hash = 59 * hash + (this.codlis != null ? this.codlis.hashCode() : 0);
        hash = 59 * hash + (this.codpos != null ? this.codpos.hashCode() : 0);
        hash = 59 * hash + (this.codtra != null ? this.codtra.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final PendienteFacturacionGrupo other = (PendienteFacturacionGrupo) obj;
        if ((this.circom == null) ? (other.circom != null) : !this.circom.equals(other.circom)) {
            return false;
        }
        if ((this.nrocta == null) ? (other.nrocta != null) : !this.nrocta.equals(other.nrocta)) {
            return false;
        }
        if ((this.cndpag == null) ? (other.cndpag != null) : !this.cndpag.equals(other.cndpag)) {
            return false;
        }
        if ((this.vnddor == null) ? (other.vnddor != null) : !this.vnddor.equals(other.vnddor)) {
            return false;
        }
        if ((this.deping == null) ? (other.deping != null) : !this.deping.equals(other.deping)) {
            return false;
        }
        if ((this.depegr == null) ? (other.depegr != null) : !this.depegr.equals(other.depegr)) {
            return false;
        }
        if ((this.codlis == null) ? (other.codlis != null) : !this.codlis.equals(other.codlis)) {
            return false;
        }
        if ((this.codpos == null) ? (other.codpos != null) : !this.codpos.equals(other.codpos)) {
            return false;
        }
        if ((this.codtra == null) ? (other.codtra != null) : !this.codtra.equals(other.codtra)) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "PendienteFacturacionGrupo{" + "circom=" + circom + ", nrocta=" + nrocta + ", cndpag=" + cndpag + ", vnddor=" + vnddor + ", deping=" + deping + ", depegr=" + depegr + ", codlis=" + codlis + ", codpos=" + codpos + ", codtra=" + codtra + '}';
    }


}
